import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Product from '../components/Product'
import ProductDetail from '../components/ProductDetail'
import History from '../components/History'
import PaymentDetail from '../components/PaymentDetail'
import OrderDetail from '../components/OrderDetail'
import Order from '../components/Order'
import Discover from '../components/Discover'
import User from '../components/User'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      name: '首页',
      component: Home
    },
    {
      path: '/product',
      name: '产品',
      component: Product
    },
    {
      path: '/history',
      name: '产品访问记录',
      component: History
    },
    {
      path: '/product/:id',
      name: '产品详情',
      component: ProductDetail
    },
    {
      path: '/payment/:id',
      name: '订单支付',
      component: PaymentDetail
    },
    {
      path: '/order',
      name: '订单列表',
      component: Order
    },
    {
      path: '/order/:id',
      name: '订单详情',
      component: OrderDetail
    },
    {
      path: '/discover',
      name: '发现',
      component: Discover
    },
    {
      path: '/user',
      name: '我的',
      component: User
    }
  ]
})
